import { NavBar, Icon, Modal, Button, WingBlank, Toast } from 'antd-mobile';
import { WhiteSpace } from 'antd-mobile';

export default class Header extends React.Component{
	render(){
		let title = this.props.title,
			leftContent = this.props.leftContent;
		return(<div>
		    <NavBar className="header-container" leftContent={leftContent} mode="light" 
			    onLeftClick={ () => 
						{
							if (this.props.onBack) {
								this.props.onBack();
							} else if(this.props.backRemind) {
								const back = confirm("是否回退到之前的页面？");
								if(back){
									window.history.back();
								}
							}else{
									window.history.back();
							}
						}
			    }
		    >{title}</NavBar>
		    <WhiteSpace size="lg" />
		</div>)
  	}
}
